<template>
	<view class="content">
		<view class="item f-c-b">
			<view>银行卡号</view>
			<view class="inp">
				<input type="text" v-model="cardInfo.cardNum" placeholder="请输入银行卡号" placeholder-class="plac"/>
			</view>
		</view>
		
		<view class="item f-c-b">
			<view>姓名</view>
			<view class="inp">
				<input type="text" v-model="cardInfo.cardName" placeholder="请输入姓名" placeholder-class="plac"/>
			</view>
		</view>
		
		<view @click="toSubmit" class="btn f-c-c cw f30">
			确认
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cardInfo:{
					cardNum:'',
					cardName:'',
				}
			}
		},
		methods: {
			async toSubmit(){
				if(this.cardInfo.cardNum==''){
					this.$u.toast('请输入银行卡号！')
					return
				}
				if(this.cardInfo.cardName==''){
					this.$u.toast('请输入姓名！')
					return
				}
				const res=await this.$u.api.addConBankcard({
					bankcardName:this.cardInfo.cardName,
					bankcardNo:this.cardInfo.cardNum,
					bankcardType:'DC',
					consumer:this.vuex_user.id,
				})
				if(!res.success){
					this.$u.toast(res.msg)
					return
				}
				console.log(res);
				this.$back(1)
			}
		}
	}
</script>

<style>
.content{
	height: 100vh;
	background-color: #F4F4F4;
	padding: 3rpx 0;
}
.item{
	background-color: #FFFFFF;
	padding: 20rpx;
}
.inp input{
	text-align: right;
}
.plac{
	font-size: 30rpx;
	color:#999999
}
.btn{
	background-color: #FF8710;
	margin: 900rpx 40rpx;
	height: 80rpx;
	border-radius: 40rpx;
}
</style>
